/*
 * Copyright 2008 Andrej Herich
 * 
 * http://azetclient.yw.sk/
 * http://azetclient.googlecode.com/
 * 
 * This file is part of AzetClient.
 * 
 * AzetClient is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * AzetClient is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with AzetClient.  If not, see <http://www.gnu.org/licenses/>.
 */

package sk.yw.azetclient.model;

import java.util.Date;

/**
 *
 * @author error216
 */
public abstract class AbstractMessageBean implements MessageBean {
    
    protected long id = 0L;
    protected Buddy sender;
    protected Buddy receiver;
    protected Date sendTime;
    protected String content;
    
    public AbstractMessageBean() {
        
    }
    
    public AbstractMessageBean(Message message) {
        if (message == null)
            throw new IllegalArgumentException("Null pointer in message");
        
        id = message.getId();
        sender = message.getSender();
        receiver = message.getReceiver();
        sendTime = message.getSendTime();
        content = message.getContent();
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Buddy getSender() {
        return sender;
    }

    public void setSender(Buddy sender) {
        this.sender = sender;
    }

    public Buddy getReceiver() {
        return receiver;
    }

    public void setReceiver(Buddy receiver) {
        this.receiver = receiver;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

}
